/*
 * Copyright (c) United Binary LLC.  All rights reserved.
 * 
 * This code is licensed under the MIT License
 * 
 * SEE: http://harnessit.codeplex.com/license
 * 
 */
using System;
using System.Diagnostics;
using UnitedBinary.UnitTests.Framework;

namespace TestingTestClasses
{
	/// <summary>
	/// Summary description for ReusedTestClass.
	/// </summary>
	[Serializable]
	[TestClass("A class to test our renew / reuse functionality.")]
	[TestExecutionMode(TestExecutionModes.Reuse)]
	public class ReusedTestClass
	{
		private int counter = 0;

		public ReusedTestClass()
		{
			Debug.WriteLine("Creating instance of ReusedTestClass");
			counter++;
		}

		[TestMethod("This is one of two test methods we want to run.")]
		[TestOrder(TestOrderModes.First,1)]
		public void RunTests1(TestMethodRecord tmr)
		{
			counter++;
			tmr.WriteLine("Running first test method.");
			tmr.RunTest(counter == 2,"Test that our counter is at two.");
		}

		[TestMethod("This is one of two test methods we want to run.")]
		[TestOrder(TestOrderModes.Last,1)]
		public void RunTests2(TestMethodRecord tmr)
		{
			tmr.WriteLine("Running second test method.");
			counter++;
			tmr.RunTest(counter == 3,"Test that our counter is now at three.");
		}
	}
}
